package Controllers;

import GUI.IS_dep_manager;
import GUI.MainGUI;
import GUI.MainScreenEngineer;
import client.ChatClient;
import entities.ISdepManager;
import entities.worker;

/**
 *@author Juan Alapin - 324507516
 *@author Giora Yaffe - 036551281
 *@author Shachar Gritzman - 300174026
 *@author Nir Porat - 021515580
*/

public class WorkersController {

	private ChatClient client;
	private MainGUI maingui;
	private MainScreenEngineer ManagerScreen;
	private ISdepManager mainManager;
	private worker manager;
	private IS_dep_manager isDepManagerScreen;
	
	public WorkersController(){
		
	}
	
	/**
	 * Constructor
	 * @param client:ChatClient
	 * @param maingui:MainGUI
	 */
	public WorkersController(ChatClient client, MainGUI maingui){
		
		this.setClient(client);
		this.setMaingui(maingui);
		if(maingui.usr.getPermissionLvl()==4){
			this.ManagerScreen = new MainScreenEngineer(this.getMaingui());
			this.ManagerScreen.setBounds(100, 100, 800, 800);
			this.ManagerScreen.setVisible(true);
			}
		else if (maingui.usr.getPermissionLvl()==5){
			this.isDepManagerScreen = new IS_dep_manager(this.getMaingui());
			this.isDepManagerScreen.setBounds(100, 100, 800, 800);
			this.isDepManagerScreen.setVisible(true);
			
			}
	}
	
	private void setManager(worker worker) {
		this.manager = worker;	
	}
	
	public MainGUI getMaingui() {
		return maingui;
	}
	
	public void setMaingui(MainGUI maingui) {
		this.maingui = maingui;
	}
	
	public ChatClient getClient() {
		return client;
	}
	
	public void setClient(ChatClient client) {
		this.client = client;
	}
	
	public ISdepManager getManager() {
		return mainManager;
	}
	
	public void setManager(ISdepManager manager) {
		this.mainManager = manager;
	}
}
